<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:jwork="http://irian.at/jsfatwork"
      xmlns:rich="http://richfaces.org/rich">

<ui:composition template="/templates/template.xhtml">
    <ui:define name="heading">
        <h:outputText value="Client Administration"/>
    </ui:define>
    <ui:define name="content">

        <rich:dataTable value="#{clientAdministrationBean.allClients}" var="client">

            <rich:column>
                <f:facet name="header">Username</f:facet>
                #{client.userName}
            </rich:column>

            <rich:column>
                <f:facet name="header">Full Name</f:facet>
                #{client.fullName}
            </rich:column>

            <rich:column>
                <h:commandButton value="Edit" action="#{clientAdministrationBean.edit}">
                    <f:setPropertyActionListener target="#{clientAdministrationBean.client}" value="#{client}"/>
                </h:commandButton>
                <h:commandButton value="Delete" action="#{clientAdministrationBean.delete}">
                    <f:setPropertyActionListener target="#{clientAdministrationBean.client}" value="#{client}"/>
                </h:commandButton>
            </rich:column>

        </rich:dataTable>

        <h:commandButton value="New" action="#{clientAdministrationBean.addNew}"/>

    </ui:define>
</ui:composition>

</html>